﻿/* NumberHelper
 */

namespace LSLib.Math
{
    using System;

    [Serializable]
    public static class NumberHelper
    {
        public static int NearestInt(double d)
        {
            return (int)System.Math.Floor(d + 0.5);
        }
        public static long NearestLong(double d)
        {
            return (long)System.Math.Floor(d + 0.5);
        }
        public static int NearestInt(float f)
        {
            return (int)System.Math.Floor(f + 0.5);
        }
        public static long NearestLong(float f)
        {
            return (long)System.Math.Floor(f + 0.5);
        }
    }
}